package cn.brilliantfuture.commentry.entity;

// Generated 2011-11-3 13:34:34 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * CardInfo generated by hbm2java
 */
@Entity
@Table(name = "card_info", catalog = "cabinet")
public class CardInfo implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer cardInfoId;
	private Purchaser purchaser;
	private String cardNumber;
	private String description;
	private Date insertTime;
	private Integer insertUser;
	private boolean deleted;
	private Integer type;
	private Integer active;

	public CardInfo() {
	}

	public CardInfo(String cardNumber, boolean deleted, Integer type, Integer active) {
		this.cardNumber = cardNumber;
		this.deleted = deleted;
		this.type = type;
		this.active = active;
	}

	public CardInfo(Purchaser purchaser, 
			String cardNumber, String description, Date insertTime,
			Integer insertUser, boolean deleted, Integer type, Integer active) {
		this.purchaser = purchaser;
		this.cardNumber = cardNumber;
		this.description = description;
		this.insertTime = insertTime;
		this.insertUser = insertUser;
		this.deleted = deleted;
		this.type = type;
		this.active = active;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "card_info_id", unique = true, nullable = false)
	public Integer getCardInfoId() {
		return this.cardInfoId;
	}

	public void setCardInfoId(Integer cardInfoId) {
		this.cardInfoId = cardInfoId;
	}

	@OneToOne
	@JoinColumn(name = "purchaser_id", unique = true)
	public Purchaser getPurchaser() {
		return this.purchaser;
	}

	public void setPurchaser(Purchaser purchaser) {
		this.purchaser = purchaser;
	}

	@Column(name = "card_number", nullable = false, length = 45)
	@NotNull
	@Length(max = 45)
	public String getCardNumber() {
		return this.cardNumber;
	}

	public void setCardNumber(String cardNumber) {
		this.cardNumber = cardNumber;
	}

	@Column(name = "description", length = 256)
	@Length(max = 256)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "insert_time", length = 10)
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "insert_user")
	public Integer getInsertUser() {
		return this.insertUser;
	}

	public void setInsertUser(Integer insertUser) {
		this.insertUser = insertUser;
	}

	@Column(name = "deleted", nullable = false)
	public boolean isDeleted() {
		return this.deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	@Column(name = "type", nullable = false)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "active", nullable = false)
	public Integer getActive() {
		return this.active;
	}

	public void setActive(Integer active) {
		this.active = active;
	}

}
